/**
 * 费率列表
 */
<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="margin-t10">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>费率列表</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="boxBlock"> 
        <div class="serachTop"> 
              <!-- 搜索筛选 -->
            <el-form :inline="true" :model="formInline" class="user-search">
              <el-form-item >
                <el-input
                  size="small"
                  v-model="formInline.name"
                  placeholder="组名"
                  clearable
                ></el-input>
              </el-form-item>
              <el-form-item>
                <el-input
                  size="small"
                  v-model="formInline.userId"
                  placeholder="输入用户ID"
                  type="number"
                  clearable
                ></el-input>
              </el-form-item>
              <el-form-item>
                <el-button
                  size="small"
                  type="primary"
                  icon="el-icon-search"
                  @click="search"
                >
                  搜索
                </el-button>
                <el-button
                  size="small"
                  type="primary"
                  icon="el-icon-plus"
                  @click="handleEdit('addForm')"
                >
                  添加
                </el-button>
              </el-form-item>
            </el-form>
        </div>
  
  
    <!--列表-->
    <div class="ra_box">
      <el-table
        size="small"
        :data="listData"
        highlight-current-row
        v-loading="loading"
        element-loading-text="拼命加载中"
        style="width: 100%"
        :row-class-name="getRowClass"
      >
        <el-table-column type="expand">
          <template slot-scope="props">
            <div class="margin-l20 margin-b10">
              <el-button size="small" type="warning" @click="delUser('')">
                批量删除
              </el-button>
            </div>
            <el-table
              :data="props.row.users"
              style="width: 40%"
              @selection-change="toggleSelection"
            >
              <el-table-column type="selection" width="55" > </el-table-column>
              <el-table-column prop="userId" label="用户ID"> </el-table-column>
              
              <el-table-column prop="userName" label="账户名称">
              </el-table-column
              ><el-table-column align="center" label="操作" width="100">
                <template slot-scope="item">
                  <el-button
                    size="mini"
                    type="danger"
                    @click="delUser(item.row)"
                  >
                    删除
                  </el-button>
                </template>
              </el-table-column>             
            </el-table>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="id" label="ID"> </el-table-column> -->
        <el-table-column prop="name" label="组名" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="open" label="开卡手续费" show-overflow-tooltip>
        </el-table-column>
        <el-table-column
            prop="createBy"
            label="操作人"
            show-overflow-tooltip
            width="120"
          >
        </el-table-column>
        <el-table-column
          prop="recharge"
          label="卡充值手续费"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="refund"
          label="交易退款手续费"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column prop="auth" label="小额交易费(常规卡)" show-overflow-tooltip>
        </el-table-column>
        <el-table-column
          prop="shareAuth"
          label="小额交易费(共享卡)"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          prop="transactionFee"
          label="共享卡交易费"
          show-overflow-tooltip
        >
        </el-table-column>

        
        <el-table-column
          prop="coverCharge"
          label="月租服务费"
          show-overflow-tooltip
        >
        </el-table-column>

        <el-table-column
          prop="crossCurrencyFee"
          label="跨币种手续费"
          show-overflow-tooltip
        >
        </el-table-column> 

        <el-table-column prop="createAt" label="创建时间" show-overflow-tooltip>
          <template slot-scope="scope">
            {{ timestampToTime(scope.row.createAt) }}
          </template>
        </el-table-column>
        <el-table-column align="left" label="操作" width="350">
          <template slot-scope="scope">
            <el-button
               size="mini"   plain
              @click="handleEdit('editForm', scope.row)"
            >
              编辑
            </el-button>
            <el-button
              size="mini"  type="success"
              @click="handleEdit('addUser', scope.row)"
              v-if="scope.row.id != 1"
               
            >
              绑定用户
            </el-button>
            <el-button
              size="mini" plain
              @click="delfee(scope.row)"
              v-if="scope.row.id != 1"
              style="color: #f74e4e; cursor: pointer;"
            >
              删除
            </el-button> 

          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 分页组件 -->
    <Pagination
      v-bind:child-msg="pageparm"
      @callFather="callFather"
    ></Pagination>
  </div>
    <!-- 新增界面  -->
    <el-dialog
      :close-on-click-modal="false"
      title="添加"
      :visible.sync="addFormVisible"
      width="1000px"
      @close="closeDialog('addForm')"
    >

      <el-alert
      show-icon
        title="固定金额收费填写数字，比如收费5U，填写5；比例收费时填写百分比，比如收费交易金额的10%，填写10%。月租服务费仅支持固定金额"
        type="error">
      </el-alert> 
      <el-form
        :model="addForm"
        :rules="rules"
        label-width="220px"
        ref="addForm"
        class="myForm"
      >
       
        <el-form-item label="组名" prop="name" class="">
          <el-input
            size="small"
            v-model="addForm.name"
            auto-complete="off"
            placeholder="请输入组名"
          ></el-input>
        </el-form-item>
        <el-form-item label="开卡手续费" prop="open" >
          <el-input
            size="small"
            v-model="addForm.open"
            auto-complete="off"
            placeholder="请输入开卡手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="卡充值手续费" prop="recharge" >
          <el-input
            size="small"
            v-model="addForm.recharge"
            auto-complete="off"
            placeholder="请输入卡充值手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="交易退款手续费" prop="refund" >
          <el-input
            size="small"
            v-model="addForm.refund"
            auto-complete="off"
            placeholder="请输入交易退款手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="小额交易费(常规卡)" prop="auth" >
          <el-input
            size="small"
            v-model="addForm.auth"
            auto-complete="off"
            placeholder="请输入小额交易费(常规卡)"
          ></el-input>
        </el-form-item>
        <el-form-item label="小额交易费(共享卡)" prop="shareAuth" >
          <el-input
            size="small"
            v-model="addForm.shareAuth"
            auto-complete="off"
            placeholder="请输入小额交易费(共享卡)"
          ></el-input>
        </el-form-item>
        <el-form-item label="月租服务费" prop="coverCharge" >
          <el-input
            size="small"
            v-model="addForm.coverCharge"
            auto-complete="off"
            placeholder="请输入月租服务费"
          ></el-input>
        </el-form-item>
        <el-form-item label="共享卡交易费" prop="transactionFee" >
          <el-input
            size="small"
            v-model="addForm.transactionFee"
            auto-complete="off"
            placeholder="请输入共享卡交易费"
          ></el-input>
        </el-form-item>

        <el-form-item label="跨币种手续费" prop="crossCurrencyFee" >
          <el-input
            size="small"
            v-model="addForm.crossCurrencyFee"
            auto-complete="off"
            placeholder="请输入跨币种手续费"
          ></el-input>
        </el-form-item>  

        <el-form-item label="备注" prop="remark" >
          <el-input
            size="small"
            v-model.trim="addForm.remark"
            auto-complete="off"
            type="textarea"
            :rows="5"
            placeholder="请输入备注"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeDialog('addForm')">取消</el-button>
        <el-button
          size="small"
          type="primary"
          :loading="loading"
          class="title"
          @click="submitForm('addForm')"
          >提交</el-button
        >
      </div>
    </el-dialog>
    <!-- 编辑界面 -->
    <el-dialog
      :close-on-click-modal="false"
      title="修改"
      :visible.sync="editFormVisible"
      width="1000px"
      @close="closeDialog"
    >
      <el-form
        :model="editForm"
        :rules="rules"
        ref="editForm"
        class="myForm"
        label-width="220px"
      >
        <el-form-item  >
          <i class="el-icon-warning-outline font12">
            固定金额收费填写数字，比如收费5U，填写5；比例收费时填写百分比，比如收费交易金额的10%，填写10%。
          </i>
          <i class="el-icon-warning-outline font12">
            月租服务费仅支持固定金额
          </i>
        </el-form-item>
        <el-form-item label="组名" prop="name"  >
          <el-input
            size="small"
            v-model="editForm.name"
            auto-complete="off"
            placeholder="请输入组名"
          ></el-input>
        </el-form-item>
        <el-form-item label="开卡手续费" prop="open" >
          <el-input
            size="small"
            v-model="editForm.open"
            auto-complete="off"
            placeholder="请输入开卡手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="卡充值手续费" prop="recharge" >
          <el-input
            size="small"
            v-model="editForm.recharge"
            auto-complete="off"
            placeholder="请输入卡充值手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="交易退款手续费" prop="refund" >
          <el-input
            size="small"
            v-model="editForm.refund"
            auto-complete="off"
            placeholder="请输入交易退款手续费"
          ></el-input>
        </el-form-item>
        <el-form-item label="小额交易费(常规卡) " prop="auth" >
          <el-input
            size="small"
            v-model="editForm.auth"
            auto-complete="off"
            placeholder="请输入交易手续费(常规卡)"
          ></el-input>
        </el-form-item>
        <el-form-item label="小额交易费(共享卡) " prop="shareAuth" >
          <el-input
            size="small"
            v-model="editForm.shareAuth"
            auto-complete="off"
            placeholder="请输入小额交易费(共享卡)"
          ></el-input>
        </el-form-item>  

        <el-form-item label="共享卡交易费" prop="transactionFee" >
          <el-input
            size="small"
            v-model="editForm.transactionFee"
            auto-complete="off"
            placeholder="请输入共享卡交易费"
          ></el-input>
        </el-form-item>

        <el-form-item label="月租服务费" prop="coverCharge" >
          <el-input
            size="small"
            v-model="editForm.coverCharge"
            auto-complete="off"
            placeholder="请输入月租服务费"
          ></el-input>
        </el-form-item>
        <el-form-item label="跨币种手续费" prop="crossCurrencyFee" >
          <el-input
            size="small"
            v-model="editForm.crossCurrencyFee"
            auto-complete="off"
            placeholder="请输入跨币种手续费"
          ></el-input>
        </el-form-item> 
        <el-form-item label="备注" prop="remark" >
          <el-input
            size="small"
            v-model.trim="editForm.remark"
            auto-complete="off"
            type="textarea"
            :rows="5"
            placeholder="请输入备注"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeDialog('editForm')"
          >取消</el-button
        >
        <el-button
          size="small"
          type="primary"
          :loading="loading"
          class="title"
          @click="submitForm('editForm')"
          >提交</el-button
        >
      </div>
    </el-dialog>
    <!-- 绑定用户 -->
    <el-dialog
      :close-on-click-modal="false"
      title="绑定用户"
      :visible.sync="addUserVisible"
      width="30%"
      @close="closeDialog('addUser')"
    >
      <el-form label-width="120px" class="myForm">
        <el-form-item label="绑定用户" class="select10 wid-9">
          <el-select
            size="small"
            v-model="userIDList"
            filterable
            multiple
            value-key="userId"
            placeholder="请输入用户名称"
          >
            <el-option
              v-for="item in options"
              :key="item.userId"
              :label="item.userName"
              :value="item"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="closeDialog('addUser')">取消</el-button>
        <el-button
          size="small"
          type="primary"
          :loading="loading"
          class="title"
          @click="addUserSubmit"
          >提交</el-button
        >
      </div>
    </el-dialog>
    <codeChoose ref="codeRef" :fromType="verType" @setParam="getParam" ></codeChoose>
  </div>
</template>

<script>
import { mapState, mapGetters } from "vuex";
import codeChoose from '@/components/codeChoose.vue'
import {
  setStoreS,
  getStoreS,
  removeStoreS,
  insertCharacter,
  timestampToTime,
  spStr,
} from "../../utils/util";
import {
  baseURL,
  req,
  reqJson,
  encrypt,
  decrypt,
  reqtoken,
  service,
  format,
  getUrl,
} from "../../api/axiosFun";
import Pagination from "../../components/Pagination";
export default {
  data() {
    return {
      loading: false,
      editFormVisible: false,
      addFormVisible: false,
      addUserVisible: false,
      b: format,
      timestampToTime: timestampToTime,
      formInline: {
        pageNum: 1,
        pageSize: 10,
        name: "",
        userId: "",
      },
      addForm: {
        auth: "",
        coverCharge: "",
        shareAuth: 0,
        name: "",
        open: "",
        recharge: "",
        crossCurrencyFee:'',
        refund: "",
        remark: "",
        users: [],
      },
      editForm: {
        crossCurrencyFee:0
      },
      // rules表单验证
      rules: {
        auth: [
          { required: true, message: "请输入小额交易费(常规卡)", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ],
        transactionFee: [
          { required: true, message: "请输入共享卡交易费", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ], 
        
        coverCharge: [
          { required: true, message: "请输入月租服务费", trigger: "blur" },
          {
            pattern: /^[0-9]+(\.\d{1,2})?$/,
            message: "请输入正确的数字",
            trigger: "blur",
          },
        ],
        crossCurrencyFee: [
          { required: true, message: "请输入跨币种手续费", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ],
        


        shareAuth: [
          { required: true, message: "请输入小额交易费(共享卡)", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(或两位小数)或者百分数",
            trigger: "blur",
          },
        ],
        name: [{ required: true, message: "请输入组名", trigger: "blur" }],
        open: [
          { required: true, message: "请输入开卡手续费", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ],
        recharge: [
          { required: true, message: "请输入卡充值手续费", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ],
        refund: [
          { required: true, message: "请输入交易退款手续费", trigger: "blur" },
          {
            pattern: /^[0-9]+(.[0-9]{1,2})?\%?$/,
            message: "请输入数字(两位小数)或者百分数",
            trigger: "blur",
          },
        ],
      },
      feeItem: "",
      userIDList: [],
      delIDList: [],
      options: [],
      listData: [], //用户数据
      // 分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 10,
        total: 10,
      },

      verArry:[],
      verType:'',
      curItem:'', 
      userInfo: null,
      fd:''
    };
  },
  // 注册组件
  components: {
    Pagination,
    codeChoose
  },
  created() {
    this.getdata(this.formInline);
    this.getInfo(); 
  },
  methods: {
    getInfo() {
      service
        .get("/api/photon/getUserInfo", {})
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.userInfo = res.data;
            this.$store.commit("user", JSON.stringify(res.data));
          } else {
            this.$message({
              type: "info",
              message: spStr(res.msg, "PhotonPay", ""),
            });
          }
        })
        .catch((err) => {
          this.$message.error(err);
        });
    }, 
    getdata(parameter) {
      let url = getUrl(parameter);
      service
        .get("/api/admin/getRateConfigList" + url, {})
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.listData = res.rows;
            this.pageparm.currentPage = this.formInline.pageNum;
            this.pageparm.pageSize = this.formInline.pageSize;
            this.pageparm.total = res.total;
          } else {
            this.$message({
              type: "info",
              message: spStr(res.msg, "PhotonPay", ""),
            });
          }
        })
        .catch((err) => {
          this.loading = false;
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    getRowClass({ row }) {
      if (row.users.length == 0) {
        return "row-expand-cover";
      } else {
        return "";
      }
    },
    // 分页插件事件
    callFather(parm) {
      this.formInline.pageNum = parm.currentPage;
      this.formInline.pageSize = parm.pageSize;
      this.getdata(this.formInline);
    },
    // 搜索事件
    search() {
      this.getdata(this.formInline);
    },
    handleEdit(name, row) {
      if (name == "editForm") {
        this.editFormVisible = true;
        this.editForm = row;
      } else if (name == "addUser") {
        this.addUserVisible = true;
        this.feeItem = row;
        this.remoteMethod();
      } else {
        this.addFormVisible = true;
      }
    },
    remoteMethod() {
      service
        .get("/api/admin/getNoRateConfigUsers", {})
        .then((res) => {
          this.loading = false;
          // if (res.code == 0) {
          this.options = res;
          // } else {
          //   this.$message({
          //     type: "info",
          //     message: res.msg,
          //   });
          // }
        })
        .catch((err) => {
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },

    getParam(val,type){  
      this.headers = val ;  
      if(type =='add'){
        this.addSaveAuth() 
      }else if(type=='edit'){
        this.editSaveAuth() 
      }else if(type=='addUser'){ 
        this.addUserSubmitVer() 
      }else if(type=='del'){ 
        this.deletefee() 
      }else if(type=='removeUserToRate'){
        this.deleteId(this.curItem);
      }
      
    },  
    editSaveAuth(){ 
         reqJson('post',"/api/admin/editRateConfig", this.editForm,{
          headers:{
            ...this.headers
          }
        })  
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.$message.success(res.msg);
            this.getdata(this.formInline);
            this.closeDialog("editForm");
          } else {
            this.$message({
              type: "info",
              message: res.msg,
            });
          }
        })
        .catch((err) => {
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    addSaveAuth(){ 
      reqJson('post',"/api/admin/editRateConfig", this.addForm,{
          headers:{
            ...this.headers
          }
        })  
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.$message.success(res.msg);
            this.getdata(this.formInline);
            this.closeDialog("addForm");
          } else {
            this.$message({
              type: "info",
              message: res.msg,
            });
          }
        })
        .catch((err) => {
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    submitForm(name) {
      this.$refs[name].validate((valid) => {
        if (!valid) return;
        this.loading = true; 
        if(this.userInfo&&this.userInfo.verifyApi){
            this.verArry =  this.userInfo.verifyApi.split(',');
          if(this.verArry.includes('/api/admin/editRateConfig')){
            this.$refs.codeRef.openDialog(); 
            if (name == "addForm") {
              this.verType = 'add'
            }else{
              this.verType = 'edit'
            }
          }else{ 
            if (name == "addForm") { 
              this.addSaveAuth()
            }else{ 
              this.editSaveAuth();
            }
          }
        }else{
            if (name == "addForm") { 
              this.addSaveAuth()
            }else{ 
              this.editSaveAuth();
            }
        }  
         
      });
    },
    delfee(row) {
      this.curItem = row;
      this.$confirm("请问您确定要删除该费率组吗?", "信息", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
      .then(() => {
        if(this.userInfo&&this.userInfo.verifyApi){
          this.verArry =  this.userInfo.verifyApi.split(',');
        if(this.verArry.includes('/api/admin/removeRateConfig')){
          this.$refs.codeRef.openDialog(); 
          this.verType = 'del'
        }else{ 
          this.deletefee(row);
        }
      }else{
        this.deletefee(row);
      }   
        
      })
      .catch((err) => {
        this.$message({
          type: "info",
          message: "已取消删除",
        });
      });
    },
    deletefee(row) { 
      reqJson('post',"/api/admin/removeRateConfig/" + this.curItem.id,{},{
          headers:{
            ...this.headers
          }
       })    
      // service
      //   .post("/api/admin/removeRateConfig/" + row.id, {})
        .then((res) => {
          if (res.code == 0) {
            this.$message.success(res.msg);
            this.getdata(this.formInline);
          } else if (res.code == 500) {
            this.$message.error(res.msg);
            return;
          }
        })
        .catch((err) => {
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    // 关闭编辑、增加弹出框
    closeDialog(name) {
      if (name == "editForm") {
        this.editFormVisible = false;
      } else if (name == "addUser") {
        this.addUserVisible = false;
        this.userIDList = [];
      } else if (name == "addForm") {
        this.addFormVisible = false;
        this.$refs.addForm.resetFields();
      }
    },

    addUserSubmitVer() { 
      reqJson('post',"/api/admin/addUserToRateConfig/" + this.feeItem.id, this.userIDList,{
          headers:{
            ...this.headers
          }
        })   
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.$message.success(res.msg);
            this.getdata(this.formInline);
            this.closeDialog("addUser");
          } else {
            this.$message({
              type: "info",
              message: res.msg,
            });
          }
        })
        .catch((err) => {
          this.loading = false;
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    addUserSubmit() {
      if (this.userIDList.length == 0) return false; 
      if(this.userInfo&&this.userInfo.verifyApi){
        this.verArry =  this.userInfo.verifyApi.split(',');
      if(this.verArry.includes('/api/admin/addUserToRateConfig')){
        this.$refs.codeRef.openDialog(); 
        this.verType = 'addUser'
      }else{ 
          this.addUserSubmitVer();
        }
      }else{
        this.addUserSubmitVer();
      }  
     
    },
    delUser(row) {
      if (row || this.delIDList.length > 0) {
        this.$confirm("请问您确定要移除该用户吗?", "信息", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
        .then(() => {   
          this.curItem = row;
          if(this.userInfo&&this.userInfo.verifyApi){
            this.verArry =  this.userInfo.verifyApi.split(',');
            if(this.verArry.includes('/api/admin/removeUserToRateConfig')){
              this.$refs.codeRef.openDialog(); 
              this.verType = 'removeUserToRate'
            }else{ 
              this.deleteId(row);
            }
          }else{
            this.deleteId(row);
          }   
         
        })
        .catch((err) => {
          this.$message({
            type: "info",
            message: "已取消移除",
          });
        });
      } else {
        this.$message({
          type: "info",
          message: "请选择用户",
        });
      }
    },
    deleteId(row) {
      let list = row.userId;
      if (!row) {
        list = this.delIDList.toString();
      } 
      reqJson('post',"/api/admin/removeUserToRateConfig?userIds=" + list, {},{
          headers:{
            ...this.headers
          }
        })   
      // service
      //.post("/api/admin/removeUserToRateConfig?userIds=" + list, {})
        .then((res) => {
          this.loading = false;
          if (res.code == 0) {
            this.$message.success(res.msg);
            this.getdata(this.formInline); 
          } else {
            this.$message({
              type: "info",
              message: res.msg,
            });
          }
        })
        .catch((err) => {
          this.loading = false;
          this.$message.error(spStr(err, "PhotonPay", ""));
        });
    },
    toggleSelection(rows) {
      this.delIDList = [];
      rows.forEach((i) => {
        this.delIDList.push(i.userId);
      });
    },
  },
};
</script>

<style scoped>
.user-search {
  margin-top: 20px;
}
.userRole {
  width: 100%;
}
/deep/ .el-table .row-expand-cover .cell .el-table__expand-icon {
  display: none;
}
.myForm .el-form-item {
  /* display: inline-block;
  margin-left: 5%; */
}

.el-form .select10 .el-select {
  width: 100%;
}
</style>

 
 